package com.shi.yibanjia.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shi.yibanjia.entity.po.Comments;
import com.shi.yibanjia.mapper.CommentsMapper;
import com.shi.yibanjia.service.CommentsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 20556
 * @description 针对表【tb_comments(评论表)】的数据库操作Service实现
 * @createDate 2024-04-17 13:10:08
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments>
        implements CommentsService {
    @Resource
    private CommentsMapper commentsMapper;

    @Override
    public IPage<Comments> getCommentWithNicknameByPage(IPage page, List<Integer> stars) {
        return commentsMapper.selectCommentWithNickname(page, stars);
    }

    @Override
    public IPage<Comments> getCommentWithNicknameByUserId(IPage page, Long userId) {
        return commentsMapper.selectCommentWithNicknameByUserId(page, userId);
    }
}




